#pragma once

#include <QMainWindow>
#include <qchart.h>
QT_CHARTS_USE_NAMESPACE
#include "ui_analyse_page.h"
#include <qmouseeventtransition.h>
#include <qboxlayout.h>
#include <qstring.h>
#include <qpushbutton.h>
#include <qpieseries.h>
#include <qpieslice.h>
#include <qbarseries.h>
#include <qchartview.h>
#include <qwidget.h>
#include <qvector.h>
#include <qlist.h>
#include <qbarcategoryaxis.h>

#include <qjsonarray.h>
#include <qjsondocument.h>
#include <qjsonobject.h>
#include <qmenu.h>

class analyse_page : public QMainWindow
{
	Q_OBJECT

public:
	analyse_page(QWidget *parent = nullptr);
	~analyse_page();


private:
	Ui::analyse_pageClass ui;
	QMenu* menu = nullptr;

	QVector<QString>datasets_name_list;
	QVector<QString>datasets_path_list;
	QVector<QString>annotations_list;
	QVector<int>types;

	const int max_analysis = 5;

	void repaint_total_chart();
	int annotParse_fromFile(QString file_name, QVector<int>& total_statist, QStringList& classes);


	/*QList<QBarSet*>total_sets;
	QBarSet* pdf_set = nullptr;
	QBarSeries* total_series = nullptr;
	QBarSeries* pdf_series = nullptr;
	QPieSeries* pie_series = nullptr;
	QPieSlice* pie_slice = nullptr;
	QChart* total_chart = nullptr;
	QChart* pdf_chart = nullptr;
	QChart* pie_chart = nullptr;
	QBarCategoryAxis* total_axis = nullptr;
	QBarCategoryAxis* pdf_axis = nullptr;*/
	QChartView* total_chart_view = nullptr;
	QChartView* pdf_chart_view = nullptr;
	QChartView* pie_chart_view = nullptr;
	QHBoxLayout* img_show_layout= nullptr;
private slots:

	void update_datasets_list();
	void widget_customContextMenuRequested(const QPoint pos);
	void place_change(int);
	void date_change(int);
};
